#ifndef CUBES_H
#define CUBES_H

#include <QMainWindow>
#include <qpainter.h>
#include <set.h>

namespace Ui {
class Cubes;
}

class Cubes : public QMainWindow
{
    Q_OBJECT

public:
    explicit Cubes(QWidget *parent = 0);
    ~Cubes();
    void paintEvent(QPaintEvent *event);

    void InitCubes();
    void init();
    void keyPressEvent(QKeyEvent *event);
    void buildCube ();
    QVector<QRect> Rotate();
    QRect Left(QRect a);
    QRect Right(QRect a);
    QRect Down(QRect a);
    QRect Up(QRect a);
    void Clear();
    void Clear2();
    void Clear3();
    void directionLR1();
    void directionLR2();
    void directionD();
    void Next();

    int from;

    QVector<QRect>vCube2;

private slots:
   void Cube_update();

   void on_pushButton_clicked();

   void on_pushButton_2_clicked();

   void on_pushButton_3_clicked();

   void on_toolButton_clicked();

private:
    Ui::Cubes *ui;
    //QRect vCubeRect1,vCubeRect2,vCubeRect3,vCubeRect4;
    QTimer *timer;//定时器
    int times;
    int cDirection;//块块移动方向
    int cCube;//块的种类
    int score;//分数
    int now;
    int next;
    bool paint;//是否重绘
    bool blsRun;//是否开始
    bool blsOver;//是否结束
    QString Display;
    QString Score;
    QVector<QRect>vCubeRect1,vCubeRect2,vCubeRect3,vCubeRect4,vCubeRect5,vCubeRect6,vCubeRect;//块块
    QVector<QRect>vCubeRect7,vCubeRect8,vCubeRect9,vCubeRect10,vCubeRect11,vCubeRect12,vCubeRect13;
    QVector<QRect>vCubeRect14,vCubeRect15,vCubeRect16,vCubeRect17,vCubeRect18,vCubeRect19;
    QVector<QRect>CubeRect1,CubeRect2,CubeRect3,CubeRect4,CubeRect5,CubeRect6,CubeRect;//块块
    QVector<QRect>CubeRect7,CubeRect8,CubeRect9,CubeRect10,CubeRect11,CubeRect12,CubeRect13;
    QVector<QRect>CubeRect14,CubeRect15,CubeRect16,CubeRect17,CubeRect18,CubeRect19;
    //QRect CubeMain;//主块
    QRect CubeTop,CubeBottom,CubeLeft,CubeRight;
    QRect CubeTop1,CubeBottom1,CubeLeft1,CubeRight1;
    QRect CubeTop2,CubeBottom2,CubeLeft2,CubeRight2;
    QRect CubeTop3,CubeBottom3,CubeLeft3,CubeRight3;
    QRect CubeTop4,CubeBottom4,CubeLeft4,CubeRight4;
    QRect CubeTop5,CubeBottom5,CubeLeft5,CubeRight5;
    QRect CubeTop6,CubeBottom6,CubeLeft6,CubeRight6;
    QRect CubeTop7,CubeBottom7,CubeLeft7,CubeRight7;
    QRect CubeTop8,CubeBottom8,CubeLeft8,CubeRight8;
    QRect CubeTop9,CubeBottom9,CubeLeft9,CubeRight9;
    QRect CubeTop10,CubeBottom10,CubeLeft10,CubeRight10;
    QRect CubeTop11,CubeBottom11,CubeLeft11,CubeRight11;
    QRect CubeTop12,CubeBottom12,CubeLeft12,CubeRight12;
    QRect CubeTop13,CubeBottom13,CubeLeft13,CubeRight13;
    QRect CubeTop14,CubeBottom14,CubeLeft14,CubeRight14;
    QRect CubeTop15,CubeBottom15,CubeLeft15,CubeRight15;
    QRect CubeTop16,CubeBottom16,CubeLeft16,CubeRight16;
    QRect CubeTop17,CubeBottom17,CubeLeft17,CubeRight17;
    QRect CubeTop18,CubeBottom18,CubeLeft18,CubeRight18;
    QRect CubeTop19,CubeBottom19,CubeLeft19,CubeRight19;
    QVector<QRect>vCube;
    QVector<QRect>vCube1;
    Set h;


};


#endif // CUBES_H
